package com.xyw.code.study202007281.controller;

import com.xyw.code.study202007281.entity.Order;
import com.xyw.code.study202007281.service.OrderServiceImpl2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/7/15
 * Time: 下午4:51
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
@RestController
public class OrderController {

    @Autowired
    private OrderServiceImpl2 orderService;

    @RequestMapping(value = "/order")
    public String order(@RequestParam(value = "source") String source){
        Order order = new Order();
        order.setSource(source);
        return orderService.hander(order)+"zvvzsvzvs";
    }

    @RequestMapping(value = "/order2")
    public String order(@RequestParam(value = "source") String source
    ,@RequestParam(value = "payMethod") String payMethod){
        Order order = new Order();
        order.setSource(source);
        order.setPayMethod(payMethod);
        return orderService.hander2(order);
    }
}
